# $Id: PKGBUILD 86740 2013-03-21 20:12:40Z thestinger $
# Maintainer: Daniel Micay <danielmicay@gmail.com>
# Contributor: Thomas Weißschuh <thomas_weissschuh lavabit com>
# Contributor: fauno <fauno@kiwwwi.com.ar>
# Contributor: SanskritFritz

pkgname=transmission-remote-cli
pkgver=1.5.0
pkgrel=1
pkgdesc="Curses interface for the daemon of the BitTorrent client Transmission"
arch=('any')
url="https://github.com/fagga/transmission-remote-cli"
license=('GPL3')
depends=('python2')
optdepends=('python2-geoip: Guess which country peers come from'
            'adns-python: Resolve IPs to host names')
source=("$pkgname-$pkgver.tar.gz::https://github.com/fagga/transmission-remote-cli/tarball/v$pkgver")
sha256sums=('ae64b84ec3db8b29b7e82e4726529e141f6cbc55e699d2caecf864ead21166cf')

build() {
  cd "$srcdir/$(ls -1td fagga-transmission-remote-cli-* | head -n 1)"
  sed -i "1s/python/python2/" transmission-remote-cli
}

package() {
  cd "$srcdir/$(ls -1td fagga-transmission-remote-cli-* | head -n 1)"

  install -Dm755 transmission-remote-cli "$pkgdir/usr/bin/transmission-remote-cli"
  install -Dm644 transmission-remote-cli.1 "$pkgdir/usr/share/man/man1/transmission-remote-cli.1"
  install -Dm755 transmission-remote-cli-bash-completion.sh "$pkgdir/usr/share/bash-completion/completions/transmission-remote-cli"
}
